package protocols
{
	import game.communication.AbstractResponseMsg;
	import game.communication.IResponseBeanParse;
	import laya.utils.Byte;
	<#list resps as resp>
	import protocols.${resp.module}.${resp.name}ResponseMsg;
	</#list>

	public class ResponseBeanParse implements IResponseBeanParse
	{
		public function ResponseBeanParse(){}

		public function parse(data:Byte):AbstractResponseMsg
		{
			var responseMsg:AbstractResponseMsg=null;
			var msgCode:int = data.getInt16();
			switch(msgCode)
			{
			<#list resps as resp>
				case MessageCode.${resp.consName}:
				{
					responseMsg = new ${resp.name}ResponseMsg();
					responseMsg.readData(data);
					break;
				}
			</#list>
				default:
				{
					break;
				}
			}
			return responseMsg;
		}
	}
}